
#ifndef __Conexion_h__
#define __Conexion_h__

#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <string>


class Conexion{
    int m_sd;
    std::string  m_peerIP;
    int m_peerPort;

public:
    friend class TCPAcceptor;
    friend class TCPConnector;
    ~Conexion();
    ssize_t send(const std::string& datos);
    std::string receive();
    std::string getPeerIP();
    int    getPeerPort();
    Conexion(int sd, struct sockaddr_in* address);

private:
    Conexion();
    Conexion(const Conexion& stream);
};

#endif
